//
//  ACChatAudienceCell.m
//  ACLiteAVUISDK
//
//  Created by Ben on 2021/4/1.
//

#import "ACChatAudienceCell.h"

@interface ACChatAudienceCell ()

@property (weak, nonatomic) IBOutlet UIImageView *headImg;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *msgLabel;


@end

@implementation ACChatAudienceCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.headImg.layer.masksToBounds = YES;
    self.headImg.layer.cornerRadius = 19.0;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setupCellContent:(ACMsgModel*)msgModel{
    self.nameLabel.text = msgModel.userName;
    self.msgLabel.text = msgModel.userMsg;
    NSString *headIconStr = msgModel.userHeadImageUrl;
    if ((![headIconStr startsWith:@"http://"] && ![headIconStr startsWith:@"https://"]) && headIconStr != nil) {
        headIconStr = [@"http://" stringByAppendingString:headIconStr];
    }
    [_headImg sd_setImageWithURL:[NSURL URLWithString:headIconStr]];
}

@end
